package shell.command;

import java.io.PrintStream;

/**
 * Commande d'arrêt du Shell.
 * 
 * @version 1.0
 */
public final class SimpleQuitCommandImpl extends ShellCommandImpl {
    /**
     * Constructeur.
     * 
     * @param context
     *            Contexte d'exécution.
     */
    public SimpleQuitCommandImpl(final ShellContext context) {
	super(context);
    }

    /**
     * @see shell.command.ShellCommand#getName().
     */
    public String getName() {
	return "quit";
    }

    /**
     * @see shell.command.ShellCommand#getUsage().
     */
    public String getUsage() {
	return "quit";
    }

    /**
     * @see shell.command.ShellCommand#getShortDescription().
     */
    public String getShortDescription() {
	return "Quit the shell";
    }

    /**
     * @see shell.command.ShellCommand#execute(String, PrintStream, PrintStream)
     *      .
     */
    public void execute(final String s, final PrintStream out,
	    final PrintStream err) {
	this.getContexte().setVar("stop", Boolean.TRUE);
	return;
    }
}
